package com.grupobbva.seguridad.domain;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the PERFIL_APLICACION_OPCION database table.
 * 
 */
@Embeddable
public class PerfilControlPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="APLICACION_ID")
	private long aplicacionId;

	@Column(name="PERFIL_ID")
	private long perfilId;

	@Column(name="OPCION_ID")
	private long opcionId;

	@Column(name="CONTROL_ID")
	private long controlId;

    public PerfilControlPK() {
    }
    public PerfilControlPK(long aplicacionId, long perfilId, long opcionId, long controlId) {
    	this.perfilId = perfilId;
    	this.aplicacionId = aplicacionId;
    	this.opcionId = opcionId;
    	this.controlId = controlId;
    }
	public long getPerfilId() {
		return this.perfilId;
	}
	public void setPerfilId(long perfilId) {
		this.perfilId = perfilId;
	}
	public long getAplicacionId() {
		return this.aplicacionId;
	}
	public void setAplicacionId(long aplicacionId) {
		this.aplicacionId = aplicacionId;
	}
	public long getOpcionId() {
		return this.opcionId;
	}
	public void setOpcionId(long opcionId) {
		this.opcionId = opcionId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PerfilControlPK)) {
			return false;
		}
		PerfilControlPK castOther = (PerfilControlPK)other;
		return 
			(this.perfilId == castOther.perfilId)
			&& (this.aplicacionId == castOther.aplicacionId)
			&& (this.opcionId == castOther.opcionId)
			&& (this.controlId == castOther.controlId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.perfilId ^ (this.perfilId >>> 32)));
		hash = hash * prime + ((int) (this.aplicacionId ^ (this.aplicacionId >>> 32)));
		hash = hash * prime + ((int) (this.opcionId ^ (this.opcionId >>> 32)));
		hash = hash * prime + ((int) (this.controlId ^ (this.controlId >>> 32)));
		
		return hash;
    }
	public long getControlId() {
		return controlId;
	}
	public void setControlId(long controlId) {
		this.controlId = controlId;
	}
}